/thing/.exec('something');

'some things are just things'.match(/thing/g);

const text = 'something';
const search = /thing/;
search.exec(text);

const text = 'something';
const search = /thing/g;
text.match(search);

const match = (s: RegExp) => 'something';
match(/thing/);

function f(s: string | string[]) {
  s.match(/e/);
}

const matchers = [/regexp/, 'package-lock.json'];
const file = '';
matchers.some(matcher => !!file.match(matcher));